# Example: Use a Maintained push button

In this example, the Maintained push button controls the type of label to print for the bag filler machine. The machine can print labels with metric or imperial weights.

## If the operator controls the type of label to print

Create a Maintained push button with the caption "Metric selected" for State 0 and "Imperial selected" for State 1. The application monitors the tag you assign to the Value connection to control the label print mode. If the operator presses the button to change the mode, the Value connection value changes, and the machine switches modes.

## If a supervisory system controls the type of label to print

If the label print mode can also be set by a supervisory system, the operator must be able to view the application’s local display to see which mode the machine is currently using. In this case, set the "Next state based on" option to Value. This causes the application to read the Value connection and update the button’s state before changing to the next state.

Assign the same tag to the Value connection and the Indicator control. This ensures that the Maintained push button always displays the current printing mode.

## See also

Causes of run-time errors for the Maintained push button

About the Maintained push buttons error state

Create Maintained push buttons

Configure the Maintained push button

Set up states for the Maintained push button

Set up controls for the Maintained push button